﻿using System;
using System.CodeDom.Compiler;
using System.Reflection;
using System.Runtime.CompilerServices;
using AutoR.ViewModels.Tasks;
using Prism.Mvvm;
using Xamarin.Forms;
using Xamarin.Forms.Internals;
using Xamarin.Forms.Xaml;
using Xamarin.Forms.Xaml.Internals;

namespace AutoR.Views.Tasks
{
	// Token: 0x0200001E RID: 30
	[XamlFilePath("Views\\Tasks\\TacticsSelect.xaml")]
	public class TacticsSelect : ContentPage
	{
		// Token: 0x06000083 RID: 131 RVA: 0x00011A9B File Offset: 0x0000FC9B
		public TacticsSelect()
		{
			this.InitializeComponent();
		}

		// Token: 0x06000084 RID: 132 RVA: 0x000103D8 File Offset: 0x0000E5D8
		private void ListView_OnItemTapped(object sender, ItemTappedEventArgs e)
		{
			((ListView)sender).SelectedItem = null;
		}

		// Token: 0x06000085 RID: 133 RVA: 0x00011AA9 File Offset: 0x0000FCA9
		private void Switch_OnToggled(object sender, ToggledEventArgs e)
		{
			TacticsSelectViewModel tacticsSelectViewModel = (TacticsSelectViewModel)base.BindingContext;
			if (tacticsSelectViewModel == null)
			{
				return;
			}
			tacticsSelectViewModel.ChangeCommand.Execute((TacticSelectItem)((Switch)sender).BindingContext);
		}

		// Token: 0x06000086 RID: 134 RVA: 0x00011AD8 File Offset: 0x0000FCD8
		[GeneratedCode("Xamarin.Forms.Build.Tasks.XamlG", "0.0.0.0")]
		private void InitializeComponent()
		{
			if (ResourceLoader.ResourceProvider != null && ResourceLoader.ResourceProvider(typeof(TacticsSelect).GetTypeInfo().Assembly.GetName(), "Views/Tasks/TacticsSelect.xaml") != null)
			{
				this.__InitComponentRuntime();
				return;
			}
			if (XamlLoader.XamlFileProvider != null && XamlLoader.XamlFileProvider(base.GetType()) != null)
			{
				this.__InitComponentRuntime();
				return;
			}
			BindingExtension bindingExtension = new BindingExtension();
			ToolbarItem toolbarItem = new ToolbarItem();
			BindingExtension bindingExtension2 = new BindingExtension();
			DataTemplate dataTemplate = new DataTemplate();
			ListView listView = new ListView();
			StackLayout stackLayout = new StackLayout();
			NameScope value = new NameScope();
			NameScope.SetNameScope(this, value);
			this.SetValue(ViewModelLocator.AutowireViewModelProperty, new bool?(true));
			this.SetValue(Page.TitleProperty, "学院选择");
			toolbarItem.SetValue(MenuItem.TextProperty, "清空");
			bindingExtension.Path = "ClearCommand";
			BindingBase binding = ((IMarkupExtension<BindingBase>)bindingExtension).ProvideValue(null);
			toolbarItem.SetBinding(MenuItem.CommandProperty, binding);
			this.ToolbarItems.Add(toolbarItem);
			bindingExtension2.Path = "List";
			BindingBase binding2 = ((IMarkupExtension<BindingBase>)bindingExtension2).ProvideValue(null);
			listView.SetBinding(ItemsView<Cell>.ItemsSourceProperty, binding2);
			listView.SetValue(ListView.HasUnevenRowsProperty, true);
			listView.ItemTapped += this.ListView_OnItemTapped;
			IDataTemplate dataTemplate2 = dataTemplate;
			TacticsSelect.<InitializeComponent>_anonXamlCDataTemplate_35 <InitializeComponent>_anonXamlCDataTemplate_ = new TacticsSelect.<InitializeComponent>_anonXamlCDataTemplate_35();
			object[] array = new object[0 + 4];
			array[0] = dataTemplate;
			array[1] = listView;
			array[2] = stackLayout;
			array[3] = this;
			<InitializeComponent>_anonXamlCDataTemplate_.parentValues = array;
			<InitializeComponent>_anonXamlCDataTemplate_.root = this;
			dataTemplate2.LoadTemplate = new Func<object>(<InitializeComponent>_anonXamlCDataTemplate_.LoadDataTemplate);
			listView.SetValue(ItemsView<Cell>.ItemTemplateProperty, dataTemplate);
			stackLayout.Children.Add(listView);
			this.SetValue(ContentPage.ContentProperty, stackLayout);
		}

		// Token: 0x06000087 RID: 135 RVA: 0x00011C8F File Offset: 0x0000FE8F
		private void __InitComponentRuntime()
		{
			this.LoadFromXaml(typeof(TacticsSelect));
		}

		// Token: 0x0200001F RID: 31
		[CompilerGenerated]
		private sealed class <InitializeComponent>_anonXamlCDataTemplate_35
		{
			// Token: 0x06000089 RID: 137 RVA: 0x00011CB8 File Offset: 0x0000FEB8
			internal object LoadDataTemplate()
			{
				BindingExtension bindingExtension = new BindingExtension();
				Image image = new Image();
				BindingExtension bindingExtension2 = new BindingExtension();
				Label label = new Label();
				BindingExtension bindingExtension3 = new BindingExtension();
				Label label2 = new Label();
				BindingExtension bindingExtension4 = new BindingExtension();
				Label label3 = new Label();
				StackLayout stackLayout = new StackLayout();
				BindingExtension bindingExtension5 = new BindingExtension();
				Label label4 = new Label();
				BindingExtension bindingExtension6 = new BindingExtension();
				Label label5 = new Label();
				BindingExtension bindingExtension7 = new BindingExtension();
				Label label6 = new Label();
				StackLayout stackLayout2 = new StackLayout();
				StackLayout stackLayout3 = new StackLayout();
				BindingExtension bindingExtension8 = new BindingExtension();
				Switch @switch = new Switch();
				StackLayout stackLayout4 = new StackLayout();
				Frame frame = new Frame();
				ViewCell viewCell = new ViewCell();
				NameScope nameScope = new NameScope();
				NameScope.SetNameScope(viewCell, nameScope);
				frame.SetValue(Frame.OutlineColorProperty, Color.MediumBlue);
				frame.SetValue(Xamarin.Forms.Layout.PaddingProperty, new Thickness(4.0));
				stackLayout4.SetValue(StackLayout.OrientationProperty, StackOrientation.Horizontal);
				stackLayout.SetValue(StackLayout.OrientationProperty, StackOrientation.Horizontal);
				stackLayout.SetValue(StackLayout.SpacingProperty, 2.0);
				bindingExtension.Path = "Tactic.Image";
				BindingBase binding = ((IMarkupExtension<BindingBase>)bindingExtension).ProvideValue(null);
				image.SetBinding(Image.SourceProperty, binding);
				image.SetValue(VisualElement.WidthRequestProperty, 80.0);
				image.SetValue(VisualElement.HeightRequestProperty, 21.0);
				stackLayout.Children.Add(image);
				bindingExtension2.Path = "Tactic.Ship.level";
				bindingExtension2.StringFormat = "Lv{0}";
				BindingBase binding2 = ((IMarkupExtension<BindingBase>)bindingExtension2).ProvideValue(null);
				label.SetBinding(Label.TextProperty, binding2);
				label.SetValue(View.VerticalOptionsProperty, LayoutOptions.Center);
				BindableObject bindableObject = label;
				BindableProperty fontSizeProperty = Label.FontSizeProperty;
				IExtendedTypeConverter extendedTypeConverter = new FontSizeConverter();
				string value = "12";
				XamlServiceProvider xamlServiceProvider = new XamlServiceProvider();
				Type typeFromHandle = typeof(IProvideValueTarget);
				int length;
				object[] array = new object[(length = this.parentValues.Length) + 6];
				Array.Copy(this.parentValues, 0, array, 6, length);
				object[] array2 = array;
				array2[0] = label;
				array2[1] = stackLayout;
				array2[2] = stackLayout3;
				array2[3] = stackLayout4;
				array2[4] = frame;
				array2[5] = viewCell;
				object service;
				xamlServiceProvider.Add(typeFromHandle, service = new SimpleValueTargetProvider(array2, Label.FontSizeProperty, nameScope));
				xamlServiceProvider.Add(typeof(IReferenceProvider), service);
				Type typeFromHandle2 = typeof(IXamlTypeResolver);
				XmlNamespaceResolver xmlNamespaceResolver = new XmlNamespaceResolver();
				xmlNamespaceResolver.Add("", "http://xamarin.com/schemas/2014/forms");
				xmlNamespaceResolver.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
				xmlNamespaceResolver.Add("prism", "clr-namespace:Prism.Mvvm;assembly=Prism.Forms");
				xamlServiceProvider.Add(typeFromHandle2, new XamlTypeResolver(xmlNamespaceResolver, typeof(TacticsSelect.<InitializeComponent>_anonXamlCDataTemplate_35).GetTypeInfo().Assembly));
				xamlServiceProvider.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(20, 135)));
				bindableObject.SetValue(fontSizeProperty, extendedTypeConverter.ConvertFromInvariantString(value, xamlServiceProvider));
				label.SetValue(VisualElement.WidthRequestProperty, 40.0);
				stackLayout.Children.Add(label);
				bindingExtension3.Path = "Tactic.Ship.TypeName";
				BindingBase binding3 = ((IMarkupExtension<BindingBase>)bindingExtension3).ProvideValue(null);
				label2.SetBinding(Label.TextProperty, binding3);
				label2.SetValue(View.VerticalOptionsProperty, LayoutOptions.Center);
				BindableObject bindableObject2 = label2;
				BindableProperty fontSizeProperty2 = Label.FontSizeProperty;
				IExtendedTypeConverter extendedTypeConverter2 = new FontSizeConverter();
				string value2 = "12";
				XamlServiceProvider xamlServiceProvider2 = new XamlServiceProvider();
				Type typeFromHandle3 = typeof(IProvideValueTarget);
				int length2;
				object[] array3 = new object[(length2 = this.parentValues.Length) + 6];
				Array.Copy(this.parentValues, 0, array3, 6, length2);
				object[] array4 = array3;
				array4[0] = label2;
				array4[1] = stackLayout;
				array4[2] = stackLayout3;
				array4[3] = stackLayout4;
				array4[4] = frame;
				array4[5] = viewCell;
				object service2;
				xamlServiceProvider2.Add(typeFromHandle3, service2 = new SimpleValueTargetProvider(array4, Label.FontSizeProperty, nameScope));
				xamlServiceProvider2.Add(typeof(IReferenceProvider), service2);
				Type typeFromHandle4 = typeof(IXamlTypeResolver);
				XmlNamespaceResolver xmlNamespaceResolver2 = new XmlNamespaceResolver();
				xmlNamespaceResolver2.Add("", "http://xamarin.com/schemas/2014/forms");
				xmlNamespaceResolver2.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
				xmlNamespaceResolver2.Add("prism", "clr-namespace:Prism.Mvvm;assembly=Prism.Forms");
				xamlServiceProvider2.Add(typeFromHandle4, new XamlTypeResolver(xmlNamespaceResolver2, typeof(TacticsSelect.<InitializeComponent>_anonXamlCDataTemplate_35).GetTypeInfo().Assembly));
				xamlServiceProvider2.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(21, 116)));
				bindableObject2.SetValue(fontSizeProperty2, extendedTypeConverter2.ConvertFromInvariantString(value2, xamlServiceProvider2));
				label2.SetValue(Label.TextColorProperty, Color.DarkBlue);
				label2.SetValue(View.MarginProperty, new Thickness(5.0, 0.0, 0.0, 0.0));
				stackLayout.Children.Add(label2);
				bindingExtension4.Path = "Tactic.Ship.Name";
				BindingBase binding4 = ((IMarkupExtension<BindingBase>)bindingExtension4).ProvideValue(null);
				label3.SetBinding(Label.TextProperty, binding4);
				label3.SetValue(View.VerticalOptionsProperty, LayoutOptions.Center);
				BindableObject bindableObject3 = label3;
				BindableProperty fontSizeProperty3 = Label.FontSizeProperty;
				IExtendedTypeConverter extendedTypeConverter3 = new FontSizeConverter();
				string value3 = "12";
				XamlServiceProvider xamlServiceProvider3 = new XamlServiceProvider();
				Type typeFromHandle5 = typeof(IProvideValueTarget);
				int length3;
				object[] array5 = new object[(length3 = this.parentValues.Length) + 6];
				Array.Copy(this.parentValues, 0, array5, 6, length3);
				object[] array6 = array5;
				array6[0] = label3;
				array6[1] = stackLayout;
				array6[2] = stackLayout3;
				array6[3] = stackLayout4;
				array6[4] = frame;
				array6[5] = viewCell;
				object service3;
				xamlServiceProvider3.Add(typeFromHandle5, service3 = new SimpleValueTargetProvider(array6, Label.FontSizeProperty, nameScope));
				xamlServiceProvider3.Add(typeof(IReferenceProvider), service3);
				Type typeFromHandle6 = typeof(IXamlTypeResolver);
				XmlNamespaceResolver xmlNamespaceResolver3 = new XmlNamespaceResolver();
				xmlNamespaceResolver3.Add("", "http://xamarin.com/schemas/2014/forms");
				xmlNamespaceResolver3.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
				xmlNamespaceResolver3.Add("prism", "clr-namespace:Prism.Mvvm;assembly=Prism.Forms");
				xamlServiceProvider3.Add(typeFromHandle6, new XamlTypeResolver(xmlNamespaceResolver3, typeof(TacticsSelect.<InitializeComponent>_anonXamlCDataTemplate_35).GetTypeInfo().Assembly));
				xamlServiceProvider3.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(22, 112)));
				bindableObject3.SetValue(fontSizeProperty3, extendedTypeConverter3.ConvertFromInvariantString(value3, xamlServiceProvider3));
				label3.SetValue(View.MarginProperty, new Thickness(15.0, 0.0, 0.0, 0.0));
				stackLayout.Children.Add(label3);
				stackLayout3.Children.Add(stackLayout);
				stackLayout2.SetValue(StackLayout.OrientationProperty, StackOrientation.Horizontal);
				bindingExtension5.Path = "Tactic.level";
				bindingExtension5.StringFormat = "等级:{0}";
				BindingBase binding5 = ((IMarkupExtension<BindingBase>)bindingExtension5).ProvideValue(null);
				label4.SetBinding(Label.TextProperty, binding5);
				label4.SetValue(View.VerticalOptionsProperty, LayoutOptions.Center);
				BindableObject bindableObject4 = label4;
				BindableProperty fontSizeProperty4 = Label.FontSizeProperty;
				IExtendedTypeConverter extendedTypeConverter4 = new FontSizeConverter();
				string value4 = "12";
				XamlServiceProvider xamlServiceProvider4 = new XamlServiceProvider();
				Type typeFromHandle7 = typeof(IProvideValueTarget);
				int length4;
				object[] array7 = new object[(length4 = this.parentValues.Length) + 6];
				Array.Copy(this.parentValues, 0, array7, 6, length4);
				object[] array8 = array7;
				array8[0] = label4;
				array8[1] = stackLayout2;
				array8[2] = stackLayout3;
				array8[3] = stackLayout4;
				array8[4] = frame;
				array8[5] = viewCell;
				object service4;
				xamlServiceProvider4.Add(typeFromHandle7, service4 = new SimpleValueTargetProvider(array8, Label.FontSizeProperty, nameScope));
				xamlServiceProvider4.Add(typeof(IReferenceProvider), service4);
				Type typeFromHandle8 = typeof(IXamlTypeResolver);
				XmlNamespaceResolver xmlNamespaceResolver4 = new XmlNamespaceResolver();
				xmlNamespaceResolver4.Add("", "http://xamarin.com/schemas/2014/forms");
				xmlNamespaceResolver4.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
				xmlNamespaceResolver4.Add("prism", "clr-namespace:Prism.Mvvm;assembly=Prism.Forms");
				xamlServiceProvider4.Add(typeFromHandle8, new XamlTypeResolver(xmlNamespaceResolver4, typeof(TacticsSelect.<InitializeComponent>_anonXamlCDataTemplate_35).GetTypeInfo().Assembly));
				xamlServiceProvider4.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(25, 131)));
				bindableObject4.SetValue(fontSizeProperty4, extendedTypeConverter4.ConvertFromInvariantString(value4, xamlServiceProvider4));
				label4.SetValue(View.MarginProperty, new Thickness(5.0, 0.0, 0.0, 0.0));
				stackLayout2.Children.Add(label4);
				bindingExtension6.Path = "Tactic.exp";
				bindingExtension6.StringFormat = "经验: {0}";
				BindingBase binding6 = ((IMarkupExtension<BindingBase>)bindingExtension6).ProvideValue(null);
				label5.SetBinding(Label.TextProperty, binding6);
				label5.SetValue(View.VerticalOptionsProperty, LayoutOptions.Center);
				BindableObject bindableObject5 = label5;
				BindableProperty fontSizeProperty5 = Label.FontSizeProperty;
				IExtendedTypeConverter extendedTypeConverter5 = new FontSizeConverter();
				string value5 = "12";
				XamlServiceProvider xamlServiceProvider5 = new XamlServiceProvider();
				Type typeFromHandle9 = typeof(IProvideValueTarget);
				int length5;
				object[] array9 = new object[(length5 = this.parentValues.Length) + 6];
				Array.Copy(this.parentValues, 0, array9, 6, length5);
				object[] array10 = array9;
				array10[0] = label5;
				array10[1] = stackLayout2;
				array10[2] = stackLayout3;
				array10[3] = stackLayout4;
				array10[4] = frame;
				array10[5] = viewCell;
				object service5;
				xamlServiceProvider5.Add(typeFromHandle9, service5 = new SimpleValueTargetProvider(array10, Label.FontSizeProperty, nameScope));
				xamlServiceProvider5.Add(typeof(IReferenceProvider), service5);
				Type typeFromHandle10 = typeof(IXamlTypeResolver);
				XmlNamespaceResolver xmlNamespaceResolver5 = new XmlNamespaceResolver();
				xmlNamespaceResolver5.Add("", "http://xamarin.com/schemas/2014/forms");
				xmlNamespaceResolver5.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
				xmlNamespaceResolver5.Add("prism", "clr-namespace:Prism.Mvvm;assembly=Prism.Forms");
				xamlServiceProvider5.Add(typeFromHandle10, new XamlTypeResolver(xmlNamespaceResolver5, typeof(TacticsSelect.<InitializeComponent>_anonXamlCDataTemplate_35).GetTypeInfo().Assembly));
				xamlServiceProvider5.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(26, 130)));
				bindableObject5.SetValue(fontSizeProperty5, extendedTypeConverter5.ConvertFromInvariantString(value5, xamlServiceProvider5));
				label5.SetValue(View.MarginProperty, new Thickness(5.0, 0.0, 0.0, 0.0));
				stackLayout2.Children.Add(label5);
				bindingExtension7.Path = "Tactic.Name";
				BindingBase binding7 = ((IMarkupExtension<BindingBase>)bindingExtension7).ProvideValue(null);
				label6.SetBinding(Label.TextProperty, binding7);
				label6.SetValue(View.VerticalOptionsProperty, LayoutOptions.Center);
				BindableObject bindableObject6 = label6;
				BindableProperty fontSizeProperty6 = Label.FontSizeProperty;
				IExtendedTypeConverter extendedTypeConverter6 = new FontSizeConverter();
				string value6 = "12";
				XamlServiceProvider xamlServiceProvider6 = new XamlServiceProvider();
				Type typeFromHandle11 = typeof(IProvideValueTarget);
				int length6;
				object[] array11 = new object[(length6 = this.parentValues.Length) + 6];
				Array.Copy(this.parentValues, 0, array11, 6, length6);
				object[] array12 = array11;
				array12[0] = label6;
				array12[1] = stackLayout2;
				array12[2] = stackLayout3;
				array12[3] = stackLayout4;
				array12[4] = frame;
				array12[5] = viewCell;
				object service6;
				xamlServiceProvider6.Add(typeFromHandle11, service6 = new SimpleValueTargetProvider(array12, Label.FontSizeProperty, nameScope));
				xamlServiceProvider6.Add(typeof(IReferenceProvider), service6);
				Type typeFromHandle12 = typeof(IXamlTypeResolver);
				XmlNamespaceResolver xmlNamespaceResolver6 = new XmlNamespaceResolver();
				xmlNamespaceResolver6.Add("", "http://xamarin.com/schemas/2014/forms");
				xmlNamespaceResolver6.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
				xmlNamespaceResolver6.Add("prism", "clr-namespace:Prism.Mvvm;assembly=Prism.Forms");
				xamlServiceProvider6.Add(typeFromHandle12, new XamlTypeResolver(xmlNamespaceResolver6, typeof(TacticsSelect.<InitializeComponent>_anonXamlCDataTemplate_35).GetTypeInfo().Assembly));
				xamlServiceProvider6.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(27, 107)));
				bindableObject6.SetValue(fontSizeProperty6, extendedTypeConverter6.ConvertFromInvariantString(value6, xamlServiceProvider6));
				label6.SetValue(View.MarginProperty, new Thickness(5.0, 0.0, 0.0, 0.0));
				stackLayout2.Children.Add(label6);
				stackLayout3.Children.Add(stackLayout2);
				stackLayout4.Children.Add(stackLayout3);
				bindingExtension8.Path = "Selected";
				BindingBase binding8 = ((IMarkupExtension<BindingBase>)bindingExtension8).ProvideValue(null);
				@switch.SetBinding(Switch.IsToggledProperty, binding8);
				@switch.SetValue(View.VerticalOptionsProperty, LayoutOptions.Center);
				@switch.SetValue(View.HorizontalOptionsProperty, LayoutOptions.EndAndExpand);
				@switch.SetValue(View.MarginProperty, new Thickness(0.0));
				@switch.Toggled += this.root.Switch_OnToggled;
				stackLayout4.Children.Add(@switch);
				frame.SetValue(ContentView.ContentProperty, stackLayout4);
				viewCell.View = frame;
				return viewCell;
			}

			// Token: 0x04000048 RID: 72
			internal object[] parentValues;

			// Token: 0x04000049 RID: 73
			internal TacticsSelect root;
		}
	}
}
